package com.nextcloud.hello.web.response;

import lombok.Data;

@Data
public class AmisResponse<T> {
    private int status;
    private String msg;
    private T data;

    public static <T> AmisResponse<T> success(T data) {
        AmisResponse<T> response = new AmisResponse<>();
        response.setStatus(0);
        response.setMsg("success");
        response.setData(data);
        return response;
    }

    public static <T> AmisResponse<T> error(int status, String msg) {
        AmisResponse<T> response = new AmisResponse<>();
        response.setStatus(status);
        response.setMsg(msg);
        return response;
    }
}